import request from "@/utils/request";

export function getListByWeek(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/getListByWeek",
		method: "get",
		params: data,
	});
}

export function getdjks(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/getdjks",
		method: "get",
		params: data,
	});
}


export function getList(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/findPage",
		method: "get",
		params: data,
	});
}

//发布 通知家长
export function fabutongzhi(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/fabutongzhi",
		method: "post",
		params: data,
	});
}

//获取家长查看课程记录状态 id
export function getParentsViewsList(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/getParentsViewsList?id=" + data,
		method: "get",
	});
}

//班级ID置换课表ID
export function zhihuanid(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/zhihuanid",
		method: "post",
		params: data,
	});
}

//班级ID置换课表ID
export function huoqurongliang(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/huoqurongliang",
		method: "post",
		params: data,
	});
}

export function findPage2(data) {
	return request({
		url: "/api/v1/system/LessonPreparationRecords/findPage",
		method: "get",
		params: data,
	});
}

export function doInsert(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/insert",
		method: "post",
		data,
		task: true
	});
}


export function updateDijikeshi(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/updateDijikeshi",
		method: "post",
		data,
	});
}

export function doUpdate(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/update",
		method: "post",
		data,
		task: true
	});
}

export function doDelete(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/del",
		method: "post",
		params: data,
	});
}

export function doDeleteAll(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/delAll",
		method: "post",
		params: data,
	});
}

/**
 * 导出Excel 目前只支持一层参数传递
 * @param data
 * @returns file
 */
export function doExportExcel(data) {
	let requestURL = "/api/v1/system/offlineTimetable/exportExcel";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 下载模版
 * @returns file
 */
export function doDownloadTemplate() {
	let data = {};
	let requestURL = "/api/v1/system/offlineTimetable/importExcel/template";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 导入Excel
 * @returns file
 */
export function doImportExcel(data) {
	return request({
		url: "/api/v1/system/offlineTimetable/importExcel",
		method: "post",
		// 最长超时时间 3 分钟
		timeout: 180000,
		headers: {
			"Content-Type": "multipart/form-data",
		},
		data,
	});
}